# 
# Copyright (C) 2008 CrisOs.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# $Id$

include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=ssd1303
PKG_REV:=23
PKG_VERSION:=r$(PKG_REV)
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://ssd1303oled.googlecode.com/svn/trunk/kernel/
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_PROTO:=svn

include $(INCLUDE_DIR)/package.mk

define KernelPackage/ssd1303
  SUBMENU:=Other modules
  DEPENDS:=@TARGET_etrax
  TITLE:=Foxboard mmc driver for oled display ssd1303
  FILES:=$(PKG_BUILD_DIR)/ssd1303.$(LINUX_KMOD_SUFFIX)
  AUTOLOAD:=$(call AutoLoad,20,ssd1303)
endef

define KernelPackage/sdd1303/description
 This package a kernel driver for oled display ssd1303
endef

define Build/Compile
	$(MAKE) -C "$(LINUX_DIR)" \
		CROSS_COMPILE="$(TARGET_CROSS)" \
		ARCH="$(LINUX_KARCH)" V="$(V)" \
		SUBDIRS="$(PKG_BUILD_DIR)" \
		KERNELVERSION="$(KERNEL)" \
		KERNEL_SOURCES="$(LINUX_DIR)" \
		KDIR="$(LINUX_DIR)" #-DOLD_IF
	# uncomment the last line  to enable old pin configuration
endef

$(eval $(call KernelPackage,ssd1303))
